﻿@{
    ViewData["Title"] = "我的奖品";
}

@section Scripts {
    <script>
        var baseURL = "https://localhost:44313";
        //当前用户ID
        var uid = $('#uid').val();

        //初始化数据
        $.post(baseURL+ '/api/Lottery/GetByUserIdQueryAsync',{userId: uid},function(res){
            if(res.code == 200){
                $('.box-content-Prizes').empty();

                if(res.count ==0){
                    $('.box-content-Prizes').addClass('box-content-text');
                }
                res.data.map(x =>{
                    var dom = `<div class="Prizes-Prize">
                            <img src=".${x.prizeImagePath}" alt="${x.prizeName}" class="img">
                            <div class="Prize-Num">当前数量: ${x.prizeCount}</div>
                            <div class="Prize-Name font_bold">${x.prizeName}</div>
                        </div>`;
                    $('.box-content-Prizes').append(dom);
                })
            }
        })
    </script>
}

<div class="box-Headr">
    <div class="box-headr-title font_bold">展览巡游 -- 打卡有奖</div>
</div>
<div class="box-content">
    <div class="box-content-headr font_bold">已获得的奖品</div>

    <div class="box-content-Prizes"></div>
</div>


